<template>
    <div>
        <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>权限管理</el-breadcrumb-item>
            <el-breadcrumb-item>权限列表</el-breadcrumb-item>
        </el-breadcrumb>
        <!--   卡片视图-->
        <el-card shadow="always">
            <el-table :data="powerList" border stripe>
                <el-table-column label="编号" prop="id"></el-table-column>
                <el-table-column label="权限名称" prop="powerName"></el-table-column>
                <el-table-column label="路径" prop="path"></el-table-column>
                <el-table-column label="级别" prop="level">
                    <template slot-scope="scope">
                        <el-tag v-if="scope.row.level===1">
                            一级
                        </el-tag  >
                        <el-tag type="success" v-if ="scope.row.level===2">
                            二级
                        </el-tag>
                        <el-tag v-if="scope.row.level===3" type="warning">
                            三级
                        </el-tag>

                    </template>
                </el-table-column>
            </el-table>
        </el-card>
    </div>

</template>

<script>
    export default {
        name: "PayMoney",
        data() {

            return {
                powerList: []
            }

        },
        created() {
            this.getPowerList()
        },
        methods: {

            async getPowerList() {
                const result = await this.$http.get('/getPowerList')

                if (result.data.code !== 1) {
                    return this.$message.error(result.data.message)
                }
                this.powerList = result.data.data

                //console.log('~~~~~~~~~~~'+this.powerList)

            }

        }
    }
</script>

<style scoped>

</style>